<template>
  <div class="panel-group">
    <div class="pie-content">
      <span class="pie-title">芝麻分</span>
      <AptitudeChart
        class="pieChart"
        :pieType="pieType.NewSesame"
        :chartData="chartData"
        :channelId="channelId"
      />
    </div>
    <div class="pie-content">
      <span class="pie-title">公积金</span>
      <AptitudeChart
        class="pieChart"
        :pieType="pieType.Accumulation"
        :chartData="chartData"
        :channelId="channelId"
      />
    </div>
    <div class="pie-content">
      <span class="pie-title">房产情况</span>
      <AptitudeChart
        class="pieChart"
        :pieType="pieType.House"
        :chartData="chartData"
        :channelId="channelId"
      />
    </div>
    <div class="pie-content">
      <span class="pie-title">车产情况</span>
      <AptitudeChart
        class="pieChart"
        :pieType="pieType.Car"
        :chartData="chartData"
        :channelId="channelId"
      />
    </div>
  </div>
</template>

<script>
require('echarts/theme/macarons'); // echarts theme
import resize from '../components/mixins/resize';
import AptitudeChart from './AptitudeChart.vue';
export default {
  mixins: [resize],
  components: {
    AptitudeChart
  },
  props: {
    chartData: {
      type: Array
    },
    channelId: {
      type: Number
    }
  },
  data() {
    return {
      listQuery: {
        startTime: '',
        endTime: ''
      },
      list: {},
      pieType: {
        NewSesame: 'NewSesame',
        Car: 'Car',
        House: 'House',
        Accumulation: 'Accumulation'
      }
    };
  }
};
</script>
<style lang="scss" scoped>
.panel-group {
  width: 100%;
  // height: 220px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  .pie-content {
    // width: calc(50% - 8px);
    // height: 100%;
    width: 50%;
    height: 180px;
    background-color: #ffffff;
    border-radius: 2px; // border: 1px solid rgba(0, 0, 0, 0.06)
    padding: 16px;
    margin-bottom: 8px;
    .pie-title {
      position: absolute;
      width: 100px;
      font-size: 16px;
      // border-left: 3px solid #376df7;
      padding: 0 4px;
      line-height: 10px;
    }
    .pieChart {
      height: 80%;
    }
  }
}
</style>
